package cn.ava.ymcc.feign.fallback;

import cn.ava.ymcc.feign.CourseUserLearnFeignClient;
import cn.ava.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseUserLearnFeignClientFallbackFactory implements FallbackFactory<CourseUserLearnFeignClient> {

    @Override
    public CourseUserLearnFeignClient create(Throwable cause) {
        return (loginId, courseId) -> JSONResult.error("课程服务异常!");
    }
}
